package com.bluedot.www.core.service;

import org.apache.commons.fileupload.FileUploadException;

import java.io.IOException;

/**
 * @author He Peng
 * @version 1.0
 * @date 2021/8/17 14:25
 */
public class Service {

    private Service() {
    }

    public static Object doService(String className, String methodName, Object[] param) throws ClassNotFoundException, IOException, FileUploadException {
        Object result = null;
        switch (className) {
            case "AlgorithmService":
                result = AlgorithmService.execute(methodName, param);
                break;
            case "AnalyzeService":
                result = AnalyzeService.execute(methodName, param);
                break;
            case "AuditService":
                result = AuditService.execute(methodName, param);
                break;
            case "BackupService":
                result = BackupService.execute(methodName, param);
                break;
            case "CustomerService":
                result = CustomerService.execute(methodName, param);
                break;
            case "CharacterReportService":
                result = CharacterReportService.execute(methodName, param);
                break;
            case "ExportService":
                result = ExportService.execute(methodName, param);
                break;
            case "FeatureStatusService":
                result = FeatureStatusService.execute(methodName, param);
                break;
            case "GroupService":
                result = GroupService.execute(methodName, param);
                break;
            case "HandwritingFeatureService":
                result = HandwritingFeatureService.execute(methodName, param);
                break;
            case "LogService":
                result = LogService.execute(methodName, param);
                break;
            case "QueryService":
                result = QueryService.execute(methodName, param);
                break;
            case "RightService":
                result = RightService.execute(methodName, param);
                break;
            case "SystemInfoService":
                result = SystemInfoService.execute(methodName, param);
                break;
            case "UserService":
                result = UserService.execute(methodName, param);
                break;
            case "ExampleService":
                result = ExampleService.execute(methodName, param);
                break;
            case "FamilyNumberService":
                result = FamilyNumberService.execute(methodName, param);
                break;
            case "RoleService":
                result = RoleService.execute(methodName, param);
                break;
            case "HandwritingImgService":
                result = HandwritingImgService.execute(methodName, param);
                break;
            default:
                throw new ClassNotFoundException("不存在类： " + className);
        }
        return result;
    }
}
